#include <glcd.h>

int data[128];

void setup(){
    GLCD.Init(); //inicializace displeje
}

void loop(){
    data[0] = map(analogRead(A0), 0, 1023, 0, 63);

    for(int i = 127; i > 0; i--){
        bod(i,data[i]); // vykresli bod
        data[i] = data[i-1]; // posune namerena data v poli
    }
    
    delay(40);
    
    GLCD.ClearScreen();
}

void bod(int x, int y){
    y = 63 - y; //prevraceni osy y
    GLCD.SetDot(x,y, BLACK); //nastaveni bodu
    GLCD.SetDot(x+1,y, BLACK);
    GLCD.SetDot(x+1,y-1, BLACK);
    GLCD.SetDot(x,y-1, BLACK);
}